////
//
/// \file ./include/inc/parser/compound_name_node.hpp
//
//  Copyright 2007, 2008 Chandler Carruth
//
//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
//  use this file except in compliance with the License.  You may obtain a copy
//  of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
//  License for the specific language governing permissions and limitations
//  under the License.
//
////

#ifndef inc_parser_compound_name_node_header
#define inc_parser_compound_name_node_header

#include <string>

#include <boost/scoped_ptr.hpp>

#include <inc/parser/parse_tree_node.hpp>

namespace inc {
namespace parser {

class DereferencedNameNode;
class IndexedNameNode;
class ScopedNameNode;

/// \brief  Compound name parsing node
/// \author Chandler Carruth
/// \date   2007.07.26
///
/// This node represents a selector of different compound name constructs. At
/// any point where any number of complex name constructs may be accepted, this
/// node provides a single representation for them.

class CompoundNameNode : public ParseTreeNode
{
public:
  CompoundNameNode();
  virtual ~CompoundNameNode();
 
  virtual bool parse( const iterator& first,
                      const iterator& last,
                      iterator& last_parsed );

  virtual DereferencedNameNode* get_dereferenced_name() const;
  virtual bool is_dereferenced_name() const
      { return get_dereferenced_name() != NULL; }

  virtual ScopedNameNode* get_scoped_name() const;
  virtual bool is_scoped_name() const
      { return get_scoped_name() != NULL; }

  virtual IndexedNameNode* get_indexed_name() const;
  virtual bool is_indexed_name() const
      { return get_indexed_name() != NULL; }

private:
  /// Private pointer to hold the internal node used
  boost::scoped_ptr<ParseTreeNode> node_ptr;
};

} //  end parser namespace
} //  end inc namespace
#endif  //  inc_parser_compound_name_node_header
